package com.mi.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mi.system.entity.RoleMenu;

import java.util.List;

/**
 * Role menu service
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/1 13:56
 */
public interface RoleMenuService extends IService<RoleMenu> {

    /**
     * 查询角色关联的菜单ID集合
     *
     * @param roleId 角色ID
     * @return 菜单ID
     */
    List<String> listMenuId(Long roleId);

    /**
     * 获取角色下的菜单权限集合
     *
     * @param roleIds 角色ID
     * @return 权限集合
     */
    List<String> listMenuPermission(Long[] roleIds);

    /**
     * save role menu
     *
     * @param menuIds menu ids
     * @param roleId  role id
     * @return result
     */
    boolean saveRoleMenu(Long[] menuIds, Long roleId);

    /**
     * update role menu
     *
     * @param menuIds menu ids
     * @param roleId  role id
     * @return result
     */
    boolean updateRoleMenu(Long[] menuIds, Long roleId);

    /**
     * remove role menu
     *
     * @param roleId role id
     * @return result
     */
    boolean removeRoleMenu(Long roleId);
}
